﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WindowsFormsApplication2;
namespace WindowsFormsApplication2
{
    class ListaNo 
    {
        private No Pri;
        private int cont;
    
        public ListaNo(){
        this.Pri = null;
        this.cont = 0;
        }
        public No getPri(){
            return this.Pri;
        }
        public void setPri(No Pri){
            this.Pri= Pri;
        }
        public int getCont()
        {
            return this.cont;
        }

        public void addNo(No ult)
        {
            No aux = this.Pri;
            if (this.Pri != null)
            {
                while (aux.getProx() != null)
                {
                    aux = aux.getProx();
                }
                aux.setProx(ult);
                this.cont++;
            }
            else
            {
                this.Pri = ult;
                this.cont++;

            }
        }
      }
}
